﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EMC.VISITOR.Application
{
    [SugarTable(null, "门禁出入记录")]
    [BusinessVS]
    public class DoorInOutRecord : EntityBase
    {
        /// <summary>
        /// 事件ID
        /// </summary>
        [SugarColumn(ColumnDescription = "事件ID", IsNullable = true)]
        public string eventId { get; set; }
        /// <summary>
        /// 事件名称
        /// </summary>
        [SugarColumn(ColumnDescription = "事件名称", IsNullable = true)]
        public string eventName { get; set; }
        /// <summary>
        /// 事件产生时间
        /// </summary>
        [SugarColumn(ColumnDescription = "事件产生时间", IsNullable = true)]
        public string eventTime { get; set; }
        [SugarColumn(ColumnDescription = "标准事件产生时间", IsNullable = true)]
        public DateTime? eventTimeOk { get; set; }
        /// <summary>
        /// 人员唯一编码
        /// </summary>
        [SugarColumn(ColumnDescription = "人员唯一编码", IsNullable = true, IndexGroupNameList = new string[] { "index_doorrec_perid" })]
        public string personId { get; set; }
        /// <summary>
        /// 卡号
        /// </summary>
        [SugarColumn(ColumnDescription = "卡号", IsNullable = true)]
        public string cardNo { get; set; }
        /// <summary>
        /// 人员名称
        /// </summary>
        [SugarColumn(ColumnDescription = "人员名称", IsNullable = true)]
        public string personName { get; set; }
        /// <summary>
        /// 人员所属组织编码
        /// </summary>
        [SugarColumn(ColumnDescription = "人员所属组织编码", IsNullable = true)]
        public string orgIndexCode { get; set; }
        /// <summary>
        /// 人员所属组织名称
        /// </summary>
        [SugarColumn(ColumnDescription = "人员所属组织名称", IsNullable = true)]
        public string orgName { get; set; }
        /// <summary>
        /// 门禁点名称
        /// </summary>
        [SugarColumn(ColumnDescription = "门禁点名称", IsNullable = true)]
        public string doorName { get; set; }
        /// <summary>
        /// 门禁点编码
        /// </summary>
        [SugarColumn(ColumnDescription = "门禁点编码", IsNullable = true)]
        public string doorIndexCode { get; set; }
        /// <summary>
        /// 门禁点所在区域编码
        /// </summary>
        [SugarColumn(ColumnDescription = "门禁点所在区域编码", IsNullable = true)]
        public string doorRegionIndexCode { get; set; }
        /// <summary>
        /// 抓拍图片地址，通过接口获取门禁事件的图片接口获取门禁事件的图片数据
        /// </summary>
        [SugarColumn(ColumnDescription = "抓拍图片地址", IsNullable = true)]
        public string picUri { get; set; }
        /// <summary>
        /// 图片存储服务的唯一标识
        /// </summary>
        [SugarColumn(ColumnDescription = "图片存储服务的唯一标识", IsNullable = true)]
        public string svrIndexCode { get; set; }
        /// <summary>
        /// 事件类型
        /// </summary>
        [SugarColumn(ColumnDescription = "事件类型", IsNullable = true)]
        public int? eventType { get; set; }
        [SugarColumn(ColumnDescription = "事件类型名称", IsNullable = true)]
        public string eventTypeName { get; set; }
        /// <summary>
        /// 进出类型(1：进  0：出  -1:未知   要求：进门读卡器拨码设置为1，出门读卡器拨码设置为2)
        /// </summary>
        [SugarColumn(ColumnDescription = "进出类型", IsNullable = true)]
        public int? inAndOutType { get; set; }
        /// <summary>
        /// 读卡器IndexCode
        /// </summary>
        [SugarColumn(ColumnDescription = "读卡器IndexCode", IsNullable = true)]
        public string readerDevIndexCode { get; set; }
        /// <summary>
        /// 读卡器名称
        /// </summary>
        [SugarColumn(ColumnDescription = "读卡器名称", IsNullable = true)]
        public string readerDevName { get; set; }
        /// <summary>
        /// 控制器设备IndexCode
        /// </summary>
        [SugarColumn(ColumnDescription = "控制器设备IndexCode", IsNullable = true)]
        public string devIndexCode { get; set; }
        /// <summary>
        /// 控制器名称
        /// </summary>
        [SugarColumn(ColumnDescription = "控制器名称", IsNullable = true)]
        public string devName { get; set; }
        /// <summary>
        /// 身份证图片uri，它是一个相对地址，可以通过获取门禁事件的图片接口，获取到图片的数据
        /// </summary>
        [SugarColumn(ColumnDescription = "身份证图片uri", IsNullable = true)]
        public string identityCardUri { get; set; }
        /// <summary>
        /// 事件入库时间
        /// </summary>
       [SugarColumn(ColumnDescription = "事件入库时间", IsNullable = true)]
        public string receiveTime { get; set; }
        /// <summary>
        /// 工号
        /// </summary>
        [SugarColumn(ColumnDescription = "工号", IsNullable = true)]
        public string jobNo { get; set; }
        /// <summary>
        /// 证件号码
        /// </summary>
        [SugarColumn(ColumnDescription = "证件号码", IsNullable = true)]
        public string certNo { get; set; }
        [Navigate(NavigateType.OneToOne, nameof(Id))]
        public VisitLog visitor { get; set; }
        #region 不需要的字段
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public override DateTime? CreateTime { get; set; }


        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public override DateTime? UpdateTime { get; set; }
        #endregion
    }
}
